img2rsrc
version 1.0
by Ernest Tomlinson

img2rsrc is a command-line utility for converting image files into ICON and MICN resources and attributes for Be applications.  Any image format for which a Datatypes or Translator Kit translator exists is acceptable.

Use img2rsrc as follows:

img2rsrc [options] <name of output file>

Specify input files with the -mf and -if options.  -mf specifies the image file to be used to create the MICN resource; -if specifies the image for the ICON resource.  If one or the other of these options is left out, img2rsrc will use the one specified image file to create both resources.  The -a option specifies that the icons are to be added to a resource file that already exists; the -f or force option, with -a, forces any existing ICON or MICN resources to be replaced.  With -a unspecified, img2rsrc will create a new resource file; -f in this case forces the deletion and replacement of any existing file of the same name as the specified output file.
Both resources are added with resource ID's of zero, and names "BEOS:L:STD_ICON" and "BEOS:M:STD_ICON" for large and small icons, respectively.  The icon attributes are set at the same time.

All images are scaled to 16x16 and 32x32, as needed.  Scaling almost always wrecks a picture, however, so it is greatly to be recommended that you create separate files for the ICON and MICN, and hand-edit them--or use img2rsrc first, and edit the crude icons afterward with "Icon-O-Matic".

Transparency is correctly handled, if the image file be saved in some format which supports transparency, and if the translator or Datatype handler be able correctly to handle transparent pixels.  My own XPMTranslator does this (I had to say it) and so you can use icon files created with a number of UNIX icon editors which save in the XPM format.

Ernest Tomlinson
real mail:  10061 Osgood Way, San Diego CA, 92126
electronic mail:  etomlins@rohan.sdsu.edu
web page:  http://www.ugcs.caltech.edu/~et/
